package Filter;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

@WebFilter("/register.do")
public class MyFilter01 implements Filter {
    public void init(FilterConfig filterConfig) throws ServletException {}

    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
            throws IOException, ServletException {
        // 在请求到达 Servlet 前处理
        System.out.println("MyFilter01 - 请求被过滤");

        // 继续执行后续的过滤器或 Servlet
        chain.doFilter(request, response);
    }

    public void destroy() {}
}
